<template>
  <div id="map"></div>
</template>

<script>
export default {
  data() {
    return {
      map: {},
    };
  },
  mounted() {
    this.load();
  },
  methods: {
    load() {
      const init = new Promise((resolve, reject) => {
        if (window.T) {
          console.log("地图初始化成功");
          resolve(window.T);
          reject("error");
        }
      });
      init.then((T) => {
        this.map = new T.Map("map");
        this.map.centerAndZoom(new T.LngLat(113.79025, 34.78283), 12);
      });
    },
  },
};
</script>
<style scoped>
#map {
  width: 1000px;
  height: 300px;
}
</style>
